package com.wpw.dream.spider.enums;

import java.util.LinkedHashMap;
import java.util.Map;


public enum SpiderRunStatusEnum {
	RUN(1,"运行中"),
	STOP(0,"停止");
	
	
	private Integer value;
	private String desc;
	private SpiderRunStatusEnum(Integer value, String desc) {
		this.value = value;
		this.desc = desc;
	}
	public Integer getValue() {
		return value;
	}
	public void setValue(Integer key) {
		this.value = key;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static String getDesc(Integer value) {
		if(value == null){
			return null;
		}
		return getMap().get(value);
	}
	private static Map<Integer,String> map;
	public static Map<Integer,String> getMap(){
		if(map != null){
			return map;
		}
		map = new LinkedHashMap<Integer,String>();
		
		for(SpiderRunStatusEnum e : SpiderRunStatusEnum.values()){
			map.put(e.getValue(), e.getDesc());
		}
		return map;
	}
}
